import React, { Component } from "react";

const DetailData = [
    { id: '01', content: "Angualr" },
    { id: '02', content: "Vue" },
    { id: '03', content: "React" },
]

export default class Detail extends Component {
    render() {
        // 接收params参数
        const { id, title } = this.props.match.params
        // 匹配id
        const findResult = DetailData.find((detailObj)=>{
            return detailObj.id === id
        })
        return (
            <div>
                <ul>
                    <li>ID:{id}</li>
                    <li>Title:{title}</li>
                    <li>Content:{findResult.content}</li>
                </ul>
            </div>
        )
    }
}